<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <link rel="shortcut icon" href="<!--{eval echo register_static('img/touch-icon-57x57.png');}-->">

    <title>粉粉管理系统</title>

    <!-- Bootstrap core CSS -->
    <link href="<!--{eval echo register_static('css/bootstrap.min.css');}-->" rel="stylesheet">
    <link href="<!--{eval echo register_static('css/bootstrap-reset.css');}-->" rel="stylesheet">

    <!--Animation css-->
    <link href="<!--{eval echo register_static('css/animate.css');}-->" rel="stylesheet">

    <!--Icon-fonts css-->
    <link href="<!--{eval echo register_static('assets/font-awesome/css/font-awesome.css');}-->" rel="stylesheet"/>
    <link href="<!--{eval echo register_static('assets/ionicon/css/ionicons.min.css');}-->" rel="stylesheet"/>

    <link href="<!--{eval echo register_static('assets/sweet-alert/sweet-alert.min.css');}-->" rel="stylesheet">

    <!-- Plugins css -->
    <link href="<!--{eval echo register_static('assets/modal-effect/css/component.css');}-->" rel="stylesheet">

    <!-- DataTables -->
    <link rel="stylesheet" href="<!--{eval echo register_static('assets/datatables/jquery.dataTables.min.css"
          rel="stylesheet');}-->"/>

    <!-- Custom styles for this template -->
    <link href="<!--{eval echo register_static('css/style.css');}-->" rel="stylesheet">
    <link href="<!--{eval echo register_static('css/helper.css');}-->" rel="stylesheet">

    <!-- My styles for this template -->
    <link href="<!--{eval echo register_static('css/common.css');}-->" rel="stylesheet">
    <!--lightbox-img-->
    <link rel="stylesheet" href="<!--{eval echo register_static('css/lightbox.css');}-->">

</head>

<body>

<!-- Aside Start-->
<!--{template admin_v2/leftside}-->
<!-- Aside Ends-->


<!--Main Content Start -->
<section class="content">

    <!-- Header -->
    <!--{template admin_v2/header}-->
    <!-- Header Ends -->


    <!-- Page Content Start -->
    <!-- ================== -->

    <div class="wraper container-fluid diary">
        <div class="row">
            <div data-example-id="media-alignment" id="diary-list-body">
                <div class="panel panel-default diary-body">

                    <!-- Default panel contents -->
                    <div class="panel-heading"><p class="text-muted">点滴详情</p></div>
                    <div class="panel-body">
                        <div class="media bs-example diary-list-item">
                            <div class="media-left">
                                <a href="admin.php?ac=admin&do=accountOperation&uid={$user['uid']}" target="_blank">
                                    <img class="media-object img-circle user-avatar" data-src="holder.js/64x64"
                                         alt="64x64" src="{$user['avatar']}"
                                         onerror="this.src='./static_v2/img/default.png'" data-holder-rendered="true"
                                         style="width: 64px; height: 64px;"></a>
                            </div>
                            <div class="media-body">
                                <div class="media-heading"><strong>{$user['nickname']}
                                    {if $user['is_vip']==0}
                                    {else}
                                    <img style="width:40px;height:40px;" src="./static/images/vip/vip.png">
                                    {/if}
                                    {if $user['is_ability']==0}
                                    {else}
                                    {if $user['ability_level']==1}
                                    <img style="width:25px;height:24px;" src="./static/images/ability/ability_s_1.png">
                                    {elseif $user['ability_level']==2}
                                    <img style="width:25px;height:24px;" src="./static/images/ability/ability_s_2.png">
                                    {elseif $user['ability_level']==3}
                                    <img style="width:25px;height:24px;" src="./static/images/ability/ability_s_3.png">
                                    {elseif $user['ability_level']==4}
                                    <img style="width:25px;height:24px;" src="./static/images/ability/ability_s_4.png">
                                    {elseif $user['ability_level']==5}
                                    <img style="width:25px;height:24px;" src="./static/images/ability/ability_s_5.png">
                                    {/if}
                                    {/if}
                                    {if $user['verified']==0}
                                    {else}
                                    <img style="width:25px;height:24px;" src="./static/images/vip/v.png">
                                    {/if}</strong>
                                </div>
                                <div class="media-object">
                                    <span>{$user['signature']}</span>
                                </div>
                                <div class="media-object diary-attr">
								<span>
									<!--{date('Y-m-d H:i',$listInfo['time'])}-->
								</span>
                                    <span>$listInfo['viewTimes']人看过</span>
                                </div>
                            </div>
                        </div>
                        {if $listInfo['voiceList']}
                        <div id="jquery_jplayer_1" class="jp-jplayer"
                             voice="http://media.fenfenriji.com{$voiceList['voiceList'][0]['attachmentPath']}"></div>
                        <div id="jp_container_1" class="jp-audio" role="application" aria-label="media player" style="display: none">
                            <div class="jp-type-single">
                                <div class="jp-gui jp-interface">
                                    <div class="jp-controls">
                                        <button class="jp-play" role="button" tabindex="0">play</button>
                                    </div>
                                    <div class="jp-volume-controls">
                                        <button class="jp-mute" role="button" tabindex="0">mute</button>
                                        <button class="jp-volume-max" role="button" tabindex="0">max volume</button>
                                        <div class="jp-volume-bar">
                                            <div class="jp-volume-bar-value"></div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        {/if}
                        <p style="margin-top: 20px;margin-bottom: 20px">
                            <!--{eval echo biaoqing_replace(str_replace("\n","<br/>",$bodyInfo['content']))}-->
                        </p>

                        <div class="media">
                            {if $listInfo['url_struct']}
                            <div class="media diary-share-structure">
                                <div class="media-left">
                                    <a href="$listInfo['url_struct'][0]['url_action']">
                                        <img class="media-object" data-src="holder.js/64x64" alt="64x64"
                                             src="http://img.fenfenriji.com{$listInfo['url_struct'][0]['url_image']}"
                                             onerror="this.src='./static_v2/img/default.png'" data-holder-rendered="true"
                                             style="width: 64px; height: 64px;"></a>
                                </div>
                                <div class="media-body">
                                    <a href="$listInfo['url_struct'][0]['url_action']">
                                    <div class="media-object diary-title">
                                        <p>$listInfo['url_struct'][0]['url_title']</p>
                                    </div>
                                    <div class="media-object diary-abbreviation">
                                        <p>$listInfo['url_struct'][0]['url_content']</p>
                                    </div>
                                    </a>
                                </div>
                            </div>
                            {/if}
                            <div class="media-body">
                                {if $attachment}
                                <div class="media-object diary-images">
                                    <div class="row">

                                        <!--{loop $attachment $val}-->
                                        <a href="http://img.fenfenriji.com{$val['attachmentPath']}"
                                           data-toggle="lightbox" data-gallery="navigateTo"
                                           data-title="{$listInfo['title']}" data-footer="xxtstudio@163.com"
                                           data-lightbox="roadtrip" class="col-sm-1">
                                            <img src="http://img.fenfenriji.com{$val['attachmentPath']}"
                                                 class="img-responsive showImg" ></a>
                                        <!--{/loop}-->
                                    </div>
                                </div>
                                {/if}
                                {if $listInfo['videoList']}
                                <div class="media-object diary-images">
                                    <div class="row">
                                        <!--{loop $listInfo['videoList'] $val}-->
                                        <video width="300" height="300" style="width: 300px;height: 300px;" controls=""
                                               name="media">
                                            <source src="http://media.fenfenriji.com{$val['attachmentPath']}"
                                                    type="video/mp4">
                                        </video>
                                        <!--{/loop}-->
                                    </div>
                                </div>
                                {/if}
                                {if $listInfo[voiceList]}
                                    <!--{loop $listInfo[voiceList] $attach}-->
                                    <div class="media-object">
                                        <audio style="border-radius:50px;width:80px;" preload="auto" controls="">
                                            <source src="http://media.fenfenriji.com{$attach[attachmentPath]}">
                                        </audio>
                                    </div>
                                    <!--{/loop}-->
                                {/if}
                                {if $listInfo['topic']}
                                <div class="media-object diary-tag">
                                    <span class="label label-info"># $listInfo['topic'][0]['name']</span>
                                </div>
                                {/if}
                                {if $listInfo['geo']}
                                <div class="media-object diary-geo">
                                    <span class="glyphicon glyphicon-map-marker" aria-hidden="true">$listInfo['geo']['name']</span>
                                </div>
                                {/if}

                            </div>
                        </div>
                    </div>

                </div>

                <div class="panel panel-primary comment-list">
                    <!-- Default panel contents -->
                    <div>$listInfo['commentTimes'] 条评论</div>
                    <!--{if empty($comments)}-->
                    <div class="panel-body">暂无评论</div>
                    <!--{/if}-->

                    <!-- List group -->
                    {if $comments}
                    <ul class="list-group" id="diary-comment-list">
                        <!--加  评论start-->
                        <!--{loop $comments $value}-->
                        <li class="list-group-item diary-comment-item" data-lastid="{$id}">
                            <div class="media">
                                <div class="media-left">
                                    <a href="admin.php?ac=admin&do=accountOperation&uid={$value['user']['uid']}"
                                       target="_blank">
                                        <img class="media-object img-circle user-avatar" data-src="holder.js/64x64"
                                             alt="64x64" src="{$value['user']['avatar']}"
                                             onerror="this.src='./static_v2/img/default.png'" data-holder-rendered="true"
                                             style="width: 64px; height: 64px;"></a>
                                </div>
                                <div class="media-body">
                                    <div class="media-heading">
                                            <span class="comment-user-nickname"> <strong>{$value['user']['nickname']}</strong>
                                            </span>
                                        <span class="comment-position">
                                                <span class="badge">{$value['position']} 楼</span>
                                            <a class="deleteComment" href="javascript:;" data-tid="{$value['tid']}" data-author_uid="{$value['author_uid']}" data-uid="{$value['uid']}" data-position="$value['position']">X
                                            </a>
                                        </span>
                                        <!--{template diary_comment_loop}-->
                                    </div>
                                    <div class="media-object diary-attr">
                                        <span>
                                            <!--{date('Y-m-d H:i',$value['time'])}-->
                                        </span>
                                    </div>
                                    <div class="media-object diary-abbreviation">
                                        <span><!--{eval echo biaoqing_replace($value['content'])}--></span>
                                    </div>
                                    <!--{if $value['attachments']}-->
                                    <div class="media-object diary-images">
                                        <div class="row">
                                            <!--{loop $value['attachments'] $val}-->
                                            <a href="http://img.fenfenriji.com{$val['attachmentPath']}"
                                               data-toggle="lightbox" data-gallery="navigateTo" data-title=""
                                               data-footer="xxtstudio@163.com" class="col-sm-2">
                                                <img src="http://img.fenfenriji.com{$val['attachmentPath']}"
                                                     class="img-responsive"></a>
                                            <!--{/loop}-->
                                        </div>
                                    </div>
                                    <!--{/if}-->

                                    <!--楼中楼评论-->
                                    <!--{loop $value['childComment']['commentList'] $v}-->
                                    <div class="media">
                                        <div class="media-body">
                                            <div class="media-object diary-attr">
                                                <span>
                                                    <!--{date('Y-m-d H:i',$v['created_at'])}-->
                                                </span>
                                            </div>
                                            <div class="media-object diary-abbreviation">
                                                <span class="comment-user-nickname">
                                                    <a href="admin.php?ac=admin&do=accountOperation&uid={$v['user']['uid']}"
                                                     target="_blank"><strong>{$v['user']['nickname']}</strong></a></span>回复：
                                                <span><!--{eval echo biaoqing_replace($v['content'])}--></span>
                                                <a class="deletechildComment" href="javascript:;" data-tid="{$value['tid']}" data-author_uid="{$value['author_uid']}" data-uid="{$value['uid']}" data-position="$v['position']" data-positionid="$v['positionId']">X</a>
                                            </div>
                                        </div>
                                    </div>
                                    <!--{/loop}-->

                                </div>
                            </div>
                        </li>
                        <!--{/loop}-->
                        <!--加 评论end-->
                    </ul>
                    {/if}
                </div>

                <div id="con-close-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
                     aria-hidden="true" style="display: none;">
                    <form action="comment.php?ac=class&op=commentDiary" method="POST">
                        <div class="modal-dialog">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×
                                    </button>
                                    <h4 class="modal-title">评论面板</h4>
                                </div>
                                <div class="modal-body">
                                    <div class="row">
                                        <div class="col-md-12 ">
                                            <div class="checkbox">
                                                <label>
                                                    <input type="checkbox" id="checkboxSuccess" name="repost" value="1">
                                                    同时转发
                                                </label>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-12">
                                            <div class="form-group no-margin">
                                                <label for="field-7" class="control-label">评论区</label>
                                                <textarea name="content" class="form-control autogrow"
                                                          id="comment-content" placeholder="你的评论内容..."
                                                          style="overflow: hidden; word-wrap: break-word; resize: horizontal; height: 104px;"></textarea>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-2">
                                            <a href="javascript:void(0)" id="picModal">
                                                <span aria-hidden="true" class="glyphicon glyphicon-picture">图片</span>
                                            </a>
                                        </div>
                                    </div>
                                </div>
                                <div class="modal-footer">
                                    <input type="hidden" name="bodyId" value="{$tid}">
                                    <input type="hidden" name="author_uid" value="{$author_uid}">
                                    <input type="hidden" name="rUid" id="comment-rUid" value="0">
                                    <input type="hidden" name="parentId" id="comment-parentId" value="0">
                                    <input type="hidden" id="comment-attachment" name="attachment" value="">
                                    <button type="button" class="btn btn-white" data-dismiss="modal">取消</button>
                                    <button type="button" class="btn btn-info" id="submit-btn"
                                            onclick="doCommand('con-close-modal');">提交
                                    </button>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>

                <div>
                    <nav>
                        <ul class="pager">
                            <li id="nextpage">
                                <a href="#">下一页</a>
                            </li>
                            <li>
                                <div class="loading"></div>
                            </li>
                        </ul>
                    </nav>
                </div>
            </div>
        </div>
    </div>

    <div id="con-close-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
         aria-hidden="true" style="display: none;">

    </div><!-- /.modal -->


    <!-- Footer Start -->
    <!--{template admin_v2/footer}-->
    <!-- Footer Ends -->


</section>
<!-- Main Content Ends -->

<!--图片-->
<script src="<!--{eval echo register_static('js/lightbox-plus-jquery.js');}-->"></script>
<!-- js placed at the end of the document so the pages load faster -->
<script src="<!--{eval echo register_static('js/jquery.js');}-->"></script>
<script src="<!--{eval echo register_static('js/bootstrap.min.js');}-->"></script>
<script src="<!--{eval echo register_static('js/pace.min.js');}-->"></script>
<script src="<!--{eval echo register_static('js/wow.min.js');}-->"></script>
<script src="<!--{eval echo register_static('js/jquery.nicescroll.js');}-->" type="text/javascript"></script>

<script src="<!--{eval echo register_static('js/jquery.app.js');}-->"></script>

<script src="<!--{eval echo register_static('js/jquery.infinitescroll.min.js');}-->"></script>
<script src="<!--{eval echo register_static('js/jquery.min.js');}-->"></script>

<script>

    $('body').scrollspy({target: '#navbar-example'});

    // 图片展示
    $(document).delegate('*[data-toggle="lightbox"]', 'click', function (event) {
        event.preventDefault();
        $(this).ekkoLightbox({
            'scale_height': true,
            'loadingMessage': '加载中...'
        });
    });

    // 语音播放
    $(document).ready(function () {
        $("#jquery_jplayer_1").jPlayer({
            ready: function () {
                var voice = $(this).attr("voice");
                var id = $(this).attr("bodyId");
                console.log(this);
                console.log(voice);
                $(this).jPlayer("setMedia", {
                    title: "Pink Voice",
                    mp3: voice
                });
            },
            swfPath: "../../dist/jplayer",
            supplied: "mp3",
            wmode: "window",
            globalVolume: true,
            useStateClassSkin: true,
            autoBlur: true,
            smoothPlayBar: true,
            keyEnabled: true
        });
    });

    var id = {$id};
    $('#diary-comment-list').infinitescroll({
                loading: {
                    msgText: "",
                    img: "../static_v2/img/loading2.gif",
                    finishedMsg: '没有新数据了哦...',
                    selector: '.loading' //loading选择器
                },
                navSelector: "#nextpage", //导航的选择器，会被隐藏
                nextSelector: "#nextpage a",//包含下一页链接的选择器
                itemSelector: ".diary-comment-item",//你将要取回的选项(内容块)
                debug: false, //启用调试信息，若启用必须引入debug.js
                dataType: 'html',//格式要和itemSelector保持一致
                animate: false, //当有新数据加载进来的时候，页面是否有动画效果，默认没有
                extraScrollPx: 300, //滚动条距离底部多少像素的时候开始加载，默认150
                errorCallback: function() { //加载完数据后的回调函数

                },
                path: function(index) { //获取下一页方法
                    return "admin.php?ac=diary_class&op=getDiaryCommentsOfAjax&id="+id+"&author_uid="+{$author_uid}+'&tid='+{$tid};
                }
            },
            function(newElements, data, url) { //回调函数
                id = newElements[0]['dataset']['lastid'];

                console.group('分页结果相关信息');
                console.log('列表数据最后一条id:'+id);
                console.log('列表共:'+newElements.length+'条');
                console.log('下一页请求地址:'+url);
                console.log(newElements);
                console.log(data);
                console.groupEnd();
            });

    //删除主楼评论
    $(document).on('click','.deleteComment',function () {
        var tid = $(this).data('tid');
        var author_uid= $(this).data('author_uid');
        var uid = $(this).data('uid');
        var position= $(this).data('position');
        $.ajax({
            url:'admin.php?ac=diary_class&op=delUserComment',
            data:{tid:tid,author_uid:author_uid,uid:uid,position:position},
            success:function (res) {
                if(res){
                    alert('操作成功!');
                    window.location.reload();
                }else{
                    alert('操作失败');
                }
            }
        })
    });

    //删除楼中楼的评论
    $(document).on('click','.deletechildComment',function () {
        var tid = $(this).data('tid');
        var author_uid = $(this).data('author_uid');
        var uid = $(this).data('uid');
        var position = $(this).data('position');
        var positionId = $(this).data('positionid');
        $.ajax({
            url:'admin.php?ac=diary_class&op=deletechildComment',
            data:{tid:tid,author_uid:author_uid,uid:uid,position:position,positionId:positionId},
            success:function (res) {
                if(res){
                    alert('操作成功!');
                    window.location.reload();
                }else{
                    alert('操作失败');
                }
            }
        })
    });

</script>
</body>
</html>
